<?php
namespace app\restaurant\model;

use app\BaseModel;
use think\facade\Db;

class OrderAddress extends BaseModel
{
    //定义表名
    protected $name = 'longbing_card_restaurant_order_address';



    /**
     * @author chenniang
     * @DataTime: 2020-09-29 11:04
     * @功能说明:分类添加
     */
    public function dataAdd($order,$input){

        $insert['uniacid'] = $order['uniacid'];

        $insert['order_id']= $order['id'];

//        if($order['order_type']==0){

            $insert['name']     = longbing_filterEmoji($input['address']['name']);

            $insert['phone']    = $input['address']['phone'];

//            $insert['province'] = $input['address']['province'];
//
//            $insert['city']     = $input['address']['city'];
//
//            $insert['area']     = $input['address']['area'];
            $insert['long']     = $input['address']['long'];

            $insert['lat']      = $input['address']['lat'];

            $insert['area']     = $input['address']['address'];

            $insert['info']     = $input['address']['address_detail'];

//        }

        $res = $this->insert($insert);

        return $res;

    }



    /**
     * @author chenniang
     * @DataTime: 2020-10-20 09:30
     * @功能说明:详情
     */
    public function dataInfo($dis){

        $data = $this->where($dis)->find();

        return !empty($data)?$data->toArray():[];

    }














}